# coding=utf-8
"""
    @project: 15python_spider
    @Author：frank
    @file： urllib_request_Request.py
    @date：2023/10/16 20:30
"""
from urllib import request

if __name__ == "__main__":
    url = 'http://httpbin.org/get'
    headers = {
        'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3)'}
    req = request.Request(url=url, headers=headers)
    res = request.urlopen(req)
    html = res.read().decode('utf-8')
    print(html)

